<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>新建介绍模板 - 我的管理中心</title>
{include file="head"}
<link href="/static/thinkct/css/basic.css?v=1" rel="stylesheet" type="text/css" /><script language="javascript" src="/static/thinkct/js/jquery.m.js"></script><script language="javascript" src="/static/thinkct/js/layui/layui.js"></script><script language="javascript" src="/static/thinkct/js/common.js?v=1"></script><script language="javascript" src="/static/thinkct/js/member.js?v=1"></script><link href="/static/thinkct/css/member.css?v=1" rel="stylesheet" type="text/css" /><link href="/static/thinkct/js/layui/css/layui.css" rel="stylesheet" type="text/css" /><script language="javascript" src="/static/thinkct/js/plupload.js"></script><script language="javascript" src="/static/thinkct/js/upload.js"></script><script language="javascript" src="/static/thinkct/editor/js/wangEditor.min.js"></script><link href="/static/thinkct/editor/css/wangEditor.min.css" rel="stylesheet" type="text/css" /></head>
<body>
<!--头部-->
{include file="uhead"}
<!--头部-->
<div class="umain">
{include file="uleft"} 
<div class="uright">
<div class="mwz">
<li class="cur">新建介绍模板</li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/member/lists/tem">返回模板列表</a>
<li class="prompt r red">您当前发布信息，需要人工审核通过后才能展示！<a onclick="noauidt('tem','');" style="color: #056dae;" data="state">如何免审?</a></li></div>
<form class="layui-form layui-font14"  name="tem" action="" method="post" enctype="multipart/form-data">

<div class="layui-form-item">
    <label class="layui-form-label">模板名称</label>
    <div class="layui-inline">
	<input  name="tit" class="layui-input" value="" maxlength="50" style='width:200px;' lay-verify="required" size="50" type="text" placeholder="模板名称2~10个字之间"/>
    </div> 
</div>

<div class="layui-form-item">
    <label class="layui-form-label">模板备注</label>
    <div class="layui-inline">
	<input  name="note" class="layui-input" value="" maxlength="50" style='width:400px;'  size="50" type="text" placeholder="非必填"/>
    </div>

</div>
<div class="layui-form-item">
    <label class="layui-form-label">显示位置</label>
    <div class="layui-inline">
		<input type="radio" name="place" value="1" title="（上方）显示在商品介绍前面"/>
		<input type="radio" name="place" checked value="0" title="（下方）显示在商品介绍后面"/>
	</div> 

</div>

  <div class="layui-form-item">
    <label class="layui-form-label">模板内容</label>
    <div class="layui-input-block form-textarea-box"><textarea name="txt" id='content' class="checkLen" ></textarea></div>
	</div>
<div class="layui-form-item">
    <label class="layui-form-label">图片</label>
    <div class="layui-input-block">
<div class="upload-box">
	<div class="container">
				<div class="statusBar">
				<div class="info"><b>1.</b>限传5张图片（含已传），尺寸不限，单图大小限3M，格式 jpg/gif/png<br><b>2.</b>图片可插入上方（模板内容），未插入将按排序依次显示在模板内容之后</div>
					<div class="btns">
					<a id="browse">选择图片</a>
					</div>
				</div>
<table  class="fu_list"   id='pluing' style="display:none;" >
            <thead>
              <tr>
                <td width="64%">待传队列（<u>0</u>）</td>
				<td width="22%" align="center"></td>
                <td width="14%" align="center">操作</td>
              </tr>
            </thead>
            <tbody id="FileListing">
            </tbody>
          </table>
				<div class="filelist">
				</div>
		
		
	</div>
</div>
</div>
</div>

<div class="layui-form-item" style='padding-bottom:15px;'>
    <label class="layui-form-label"></label>
    <div class="layui-input-block"><input type="submit" class="layui-btn" lay-submit=""  value="确认提交" /></div>
</div>
  <input type="hidden" name="bh" value="160341976132">
  <input type="hidden" name="action" value="add">
  <input type="hidden" name="passkey" value="e73d520fe379c97a5ba236837ab2f127806d1e888f1509611b091b7e3757c9a2263317671b2162c3a9b816f415d10f6d5d54a3729af3e8eaf4ca875bc1fd01e6br+w2hiN3QcnAF+nNCjh6uoAoz+pRtQoavgPVgUTipQ=">
</form>
 </div>
</div>
{include file="bottom"}<script type="text/javascript">
function banKey(text){if(!text)return[];var str='{$bankey}',strs=decodeURIComponent(str).split(','),list=[];strs.forEach(v=>{var v=v.toLowerCase();if(text.toLowerCase().indexOf(v)>-1&&$.inArray(v,list)<0)list.push(v)});return list}
layui.use('form',function(){var form=layui.form();form.on('submit',function(data){var isOK=true,BanKeyTrue=false;if(editor.$txt.text().length<10){layer.tips("模板内容不能少于10个字",".wangEditor-txt",{tips:1});$(".wangEditor-txt").val('').focus();return false}$('.demandtips').remove();editor.$txt.html(editor.$txt.html().replace(/<\/?(cite)[^>]*>/gi,''));$.each(['tit','cdes','txt','note'],function(key,name){var input=$('[name='+name+']'),Res=banKey(input.val());if(Res.length>0){var div=input.closest(".layui-form-item"),tips='【'+div.find(".layui-form-label").html().replace(/[^0-9\u4e00-\u9fa5]/g,'')+'】含有违禁关键词：<font class="red">'+Res.join('、')+'</font>',html='<div class="demandtips" style="margin:15px 20px 0 110px;padding:8px 10px 5px 10px"><a class="close" onclick="$(this).parent().fadeOut(\'slow\');" title="关闭提示">X</a><p class="title"><i class="icons" style="margin-top:-12px"></i><b style="font-size:14px;">'+tips+'</b></p></div>';div.prev().attr('class')=='demandtips'?div.prev().find('b').html(tips):div.before(html);if(name=='txt'){Res.forEach(v=>{editor.$txt.html(editor.$txt.html().replace(new RegExp(v,"gm"),'<cite style="background:red;color:#fff;">'+v.trim()+'</cite>'))})}isOK=false;BanKeyTrue=true}});if(BanKeyTrue)scTop(".demandtips:eq(0)",15);if(!isOK){return false}if(uploader.total.queued>0){progress();$('#progress-upload').html(uploader.total.queued);uploader.start();return false}else{progress(true);return true}})});layer_psort=function(){psort='';$(".filelist div").each(function(i){ $(this).find('.icon').html(i+1);psort+=$(this).find('.fdel').attr('id')+","});$('#psort').val(psort)};$('.filelist .fleft,.fright').live('click',function(){var $v=0;if($('.filelist div').length<2){layer.alert("亲，就我1个，您想移哪去？",{icon:0});return false}$(".filelist .file-panel").css({"height":"0"});$this=$(this).closest('div');$athis=$this.prev();$bthis=$athis;if($(this).attr('class')=="fright"){ $athis=$this;$this=$this.next();$bthis=$this}if($bthis.length<=0){ $this=$(".filelist div:first");$athis=$(".filelist div:last");$v=1}$this.animate({top:$athis.position().top-$this.position().top,left:$athis.position().left-$this.position().left},"300",function(){if($v==1){ $athis.after($this);if($('.filelist div').length>2){ $(".filelist div:first").before($athis)}}else{ $athis.before($this)}});$athis.animate({top:$this.position().top-$athis.position().top,left:$this.position().left-$athis.position().left},"300",function(){ $('.filelist div').css({"left":"0","top":"0"});layer_psort()})});$(".filelist div").live('mouseenter',function(){ $(this).find('.file-panel').stop().animate({height:30})});$(".filelist div").live('mouseleave',function(){ $(this).find('.file-panel').stop().animate({height:0})});$('.file-panel a').live({mouseenter:function(){ $(this).find("span").addClass("cur")},mouseleave:function(){ $(this).find("span").removeClass("cur")}});var maxnum=5,stop=0;$(".filelist .fdel").live('click',function(){var $this=$(this);$.ajax({type:"POST",url:"/upload/",async:true,data:"action=del&p=160341976132&object="+$this.attr('id')+"&type=tem",success:function(is){var arr=is.split('|');var datas=$.trim(arr[0]);if(datas==0){layer.login('再删除',$this.attr('id'))}else if(datas==1){ $this.closest('div').remove();layer.psort();if($('.filelist div').length<=0){ $('.filelist').hide();return false}}else{layer.alert(arr[1],{icon:datas})}},error:function(){layer.msg('网络异常，请重试');return false}})});var uploader=new plupload.Uploader({runtimes:'html5,flash,silverlight,html4',browse_button:'browse',url:"/upload/",resize:{width:900},max_retries:1,flash_swf_url:'/static/thinkct/js/Moxie.swf',silverlight_xap_url:'/static/thinkct/js/Moxie.xap',filters:{prevent_duplicates:true,max_file_size:'3mb',mime_types:[{title:"图片文件",extensions:"jpg,png,gif"}]},multi_selection:true});uploader.init();uploader.bind('FilesAdded',function(uploader,files){var newnum=maxnum-parseInt($('.filelist div').length+$('#FileListing tr').length),flen=files.length,fhtml,vhtml='',ehtml='';if(flen>newnum){layer.alert("<strong>演示图最多能上传"+maxnum+"张（含已传）</strong>",{icon:2});uploader.splice(newnum,10000)}for(var i=0;i<=flen;i++){if(i==flen){if(ehtml!=''){layer.alert("<strong>以下图片已传过了，不要重复上传</strong><br>"+ehtml,{icon:0})}if(uploader.files.length>0){ $('#pluing').show();$(fhtml).appendTo('#FileListing');$('#pluing u').html(uploader.files.length);}return false}if(i>=newnum){continue}var fname=files[i].name,fid=files[i].id,fSuffix=fname.substr(fname.indexOf(".")),f5name=$.md5(files[i].size+files[i].lastModifiedDate+files[i].type)+fSuffix;vhtml='<tr id="file-'+fid+'"><td>'+fname+'</td><td></td><td align="center"><a onclick=deling("'+fid+'")>取消</a></td></tr>';$(".filelist .fdel").each(function(){if($(this).attr('id')==f5name){vhtml='';uploader.removeFile(fid);ehtml+="【"+fname+"】<br>";return false}});fhtml=fhtml+vhtml}});uploader.bind("BeforeUpload",function(uploader,file){uploader.setOption("multipart_params",{lastDate:file.lastModifiedDate,osize:file.size,number:'160341976132',action:'add',type:'tem',maxnum:maxnum})});uploader.bind("UploadProgress",function(uploader,file){ $('#progress-in').width(uploader.total.percent+"%");$("#file-"+file.id+" td:eq(2)").html("<b>"+file.percent+"%</b>")});uploader.bind("FileUploaded",function(uploader,file,info){ $('#progress-uploaded').html(uploader.total.uploaded);var data=$.parseJSON(info.response);if(data.state!=0){ $fh=$('#progress ul');$fh.show();$('<p><span>'+file.name+'</span><br><b>'+data.state+' >> 继续执行…</b></p>').appendTo($fh);stop=4000}});uploader.bind("UploadComplete",function(uploader){setTimeout("$(\"form\").submit()",stop)});uploader.bind("Error",function(uploader,err){if(err.message=='HTTP Error.'){fid=err.file.id;$("#file-"+fid+" td:eq(1)").html("<font color=red>系统出错，代码"+err.code+"</font>");$("#file-"+fid+" td:eq(2)").html('<a onclick=deling("'+fid+'")>删除</a>');return false}layer.alert("<strong>"+err.message+"</strong>",{icon:5})});var editor=new wangEditor('content');editor.onchange=function(){editor.$txt.find("img").remove()};editor.create();
</script>
</body>
</html>